package com.yenchingcheng.entity;

/**
 * @Author Yenchingcheng
 * @Date 2023/6/29 14:37
 * @Description 矩形类，实现了形状抽象类
 **/
public class Rectangle extends Shape {

    private double x;
    private double y;
    private double length;
    private double width;

    public Rectangle(double x, double y, double length, double width, DrawAPI api) {
        super(api);
        this.x = x;
        this.y = y;
        this.length = length;
        this.width = width;
    }

    @Override
    public void draw() {
        api.drawRectangle(x, y, length, width);
    }
}
